#pragma once

#include <tuple>
#include <utility>
#include <vector>

// An implimentation of the Graph data structre as an adjacency list.
// Edges are stored lowest index value first.
// Add() overwrites if a duplicate entry is found.
// Probably pretty fucking slow. Should probably order the entries so I can do binary search, etc.

class Graph{
    public:
        bool Adjacent(int a, int b);
        float Weight(int a, int b);

        std::vector<int> Neighbours(int a);
        void Add(int a, int b, float weight);   //Overwrites duplicates
        void Delete(int a, int b);
        const std::vector<std::tuple<int, int, float>> & GetAllEdges(){ return edges; }

        int size(){ return edges.size(); }

        void Print();
    protected:
        std::vector<std::tuple<int, int, float>> edges;
};
